home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-01 | 1.6 KB | 74 lines | [TEXT/DWat] |
- % Asymptote Demo #5
-
- % Plot the same data three different ways.
-
- datafile Measurements
- datalines 2 % Start reading at line 2 (skip line 1)
-
- graphunits inches
- graphframe 1 4 7 10
- fullscreen yes
-
- % Read the area data from column 2, calculate
- % a histogram and plot the result
- readcolumn x 2
- rpn <x log >x
- rpn <x >y
- % Find the range of values
- graphlimits
- % Count the values that fall into 12 bins that
- % cover the range of x values with a 0.5 unit 'margin'
- binxy 12 count xleft 0.5 - xright 0.5 +
- graphlimits
- plothistogram 0
- graphticks -1 0 0 0
- drawframe
- drawxlabel Log Area (cm\u2)
-
- % Move the frame over by 3.5 inches then
- % do the same for the mass data in column 3.
- graphframe gleft 3.5 + gright 3.5 + gbottom gtop
- showgraph
- readcolumn x 3
- rpn <x log >x
- rpn <x >y
- graphlimits
- binxy 12 count xleft 0.5 - xright 0.5 +
- graphlimits
- plothistogram 0
- graphticks -1 0 0 0
- drawframe
- drawxlabel Log Mass (gm)
-
- % Set the frame for the x,y plot
- graphframe 1 gright 1 gbottom 1 -
- showgraph
- readcolumn x 2
- readcolumn y 3
- closewindow \f
- rpn <x log >x
- rpn <y log >y
- graphlimits
- graphticks -1 0 -1 0
- pointsymbol 4 cross
- plotpoints
- % Fit the data with a powerlaw and store the
- % result in the y vector.
- powerlawfit xleft xright
- plotline
- drawframe
- drawxlabel Log Mass (gm)
- drawylabel Log Area (cm\u2)
- TL % TL is a command macro that moves the pen to the top
- % left corner of the frame
- scale 3
- digits 5
- drawlabel belowright Mass \s¦ Area\\u\a1
-
- % Put a frame around all three graphs
- % and draw a title at the top of the page.
- scale 1.5
- graphframe 1 7.5 1 10
- drawtitle Multiple Plots on One Page
-
- showpage